package com.zhaojiadi.bridge.channel;

import com.zhaojiadi.bridge.mode.IPayMode;

import java.math.BigDecimal;

/**
 * @Description:
 */
public class WxPay extends Pay{
    public WxPay(IPayMode payMode) {
        super(payMode);
    }

    @Override
    public String transfer(String uId, String tradeId, BigDecimal amount) {
        System.out.printf("模拟微信渠道支付划账开始。uId：%s tradeId：%s amount：%4d \r\n",uId , tradeId, amount);
        boolean security = payMode.security(uId);
        System.out.printf("模拟微信渠道支付风控校验。uId：%s tradeId：%s security：%s \r\n", uId, tradeId, security);
        if (!security) {
            System.out.printf("模拟微信渠道支付划账拦截。uId：%s tradeId：%s amount：%4d \r\n", uId, tradeId, amount);
            return "0001";
        }
        System.out.printf("模拟微信渠道支付划账成功。uId：{} tradeId：{} amount：{}", uId, tradeId, amount);
        return "0000";
    }


}
